package com.chenl.provider.util;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ExcelTemplateEnums {
    // 导入模板
    RESOURCE_INFO("resourceInfo", "resourceInfo", "资源导入模板"),
    RESOURCE_INFO2("resourceInfo2", "resourceInfo2", "资源导入模板2"),
    ITEM_LABEL("itemLabel", "itemLabel", "标签导入商品模板"),
    DICT_LABEL("dictLabel", "dictLabel", "标签导入字典模板"),
    ITEM_TEMPLATE_SPU("itemTemplate_spu", "itemTemplate_spu", "商品信息导入模板"),
    ITEM_TEMPLATE_SKU("itemTemplate_sku", "itemTemplate_sku", "商品信息导入模板"),
    PER_USERTEMPLATE("userTemplate", "userTemplate", "人员信息导入模板"),

    ;

    private final String business;
    private final String fileName;
    private final String downloadName;

    public static ExcelTemplateEnums getTemplate(String business) {
        if (business == null) {
            throw new RuntimeException("模板不存在");
        }
        for (ExcelTemplateEnums e : values()) {
            if (e.business.equals(business)) {
                return e;
            }
        }
        return null;
    }

}
